//
//  NRWPriceChooseCell.m
//  NRWMall
//
//  Created by 邢毅 on 2018/6/8.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "NRWPriceChooseCell.h"

@implementation NRWPriceChooseCell
{
    UILabel *_mLabel;
    NSString *_mPriceFrom;
    NSString *_mPriceTo;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    
    self.contentView.layer.borderColor = mainColor().CGColor;
    self.contentView.layer.borderWidth = 0.5;
    self.contentView.layer.cornerRadius = 3;
    self.contentView.layer.masksToBounds = YES;
    
    _mLabel = [[UILabel alloc] initWithFrame:self.bounds];
    _mLabel.font = getThemeFont(13);
    _mLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_mLabel];
}

- (void)setPriceTitle:(NSString *)priceTitle {
    
    _priceTitle = priceTitle;
    
    _mLabel.text = priceTitle;
}

- (void)setIsSelect:(BOOL)isSelect {
    
    _isSelect = isSelect;
    
    if (isSelect) {
        _mLabel.textColor = [UIColor whiteColor];
        self.contentView.backgroundColor = mainColor();
    } else {
        _mLabel.textColor = mainColor();
        self.contentView.backgroundColor = [UIColor whiteColor];
    }
}

- (NSString *)priceFrom {
    
    return _mPriceFrom;
}

- (NSString *)priceTo {
    
    return _mPriceTo;
}

@end
